package main

import "fmt"

func main() {
	m := make(map[int]string)
	m[1] = "val1"
	m[2] = "val2"
	m[3] = "val3"
	fmt.Println(m)

	m1 := map[string]int{
		"key1": 111,
		"key2": 222,
	}
	m1["key1"] = 666 // 更新 key1 的值未 666
	m1["key3"] = 888 // 插入一个新键值对 key3:888
	fmt.Println(m1)

	m2 := map[int]string{}
	m2[1] = "abc"
	m2[2] = "qwer"
	fmt.Println(len(m2)) // len = 2
	m2[3] = "bnmm"
	fmt.Println(len(m2)) // len = 3
}
